﻿@{
    ViewBag.Title = "用户中心";
    Layout = "~/Views/Shared/_LayoutFore.cshtml";
    var loginUserInfo = System.Web.HttpContext.Current.Session["CurrentUser"] as LY.Entity.U_Member;
    var memberInfo = ViewBag.memberInfo;

    var loginName = "";
    var module = "";
    var headImage = "";//头像
    var realName = "";//实名认证
    var mobilePhone = "";//手机验证
    var email = "";//邮箱验证
    var password = "";//密码验证
    var member = "";
    var Classify = "";//用户身份

    var CompanyName = "";//公司名称
    var Faxes = "";//公司传真
    var Status = 0;//公司认证状态
    bool IsIDValidate = false;//实名认证状态
    var RealName = "";//真实姓名
    var Mobilenumber = "";//手机号码
    bool IsEmailValidate = false;//邮箱认证状态
    bool IsCardValidate = false;//身份证认证状态;
    bool IsPasswordValidate = false;//

    if (memberInfo != null)
    {
        Classify = ((LY.Entity.U_Member)memberInfo).Classify;
    }

    if (loginUserInfo != null)
    {
        loginName = ((LY.Entity.U_Member)loginUserInfo).Nickname;


        headImage = ((LY.Entity.U_Member)loginUserInfo).HeadImage == "" ? "/Content/Images/user1.gif" : ((LY.Entity.U_Member)loginUserInfo).HeadImage;

        CompanyName = ViewBag.CompanyName;
        Faxes = ViewBag.Faxes;
        Status = ViewBag.Status;
        IsIDValidate = ((LY.Entity.U_Member)loginUserInfo).IsIDValidate;
        IsEmailValidate = ((LY.Entity.U_Member)loginUserInfo).IsEmailValidate;
        RealName = ((LY.Entity.U_Member)loginUserInfo).RealName;
        Mobilenumber = ((LY.Entity.U_Member)loginUserInfo).Mobilenumber;
        IsCardValidate = ((LY.Entity.U_Member)loginUserInfo).IsCardValidate;
        IsPasswordValidate = ((LY.Entity.U_Member)loginUserInfo).IsPasswordValidate;

        //实名认证
        var a = " <a class=\"u-security\" href=\"javascript:;\"   data-msg=\"您已开通盛付通。<a   href='../Account/AccountInfo'>查看详情</a>\"><img src=\"/Content/Images/user1.png\" data-step=\"4\" data-intro=\"查看您的第三方托管账户！\"/></a>";
        var b = " <a class=\"u-security\" href=\"javascript:;\"  data-msg=\"您还未开通盛付通。<a  href='../Account/AccountInfo'>立刻开通</a>\"><img src=\"/Content/Images/user1-1.png\"  data-step=\"4\" data-intro=\"开通您的第三方托管账户！\"/></a>";
        realName = ((LY.Entity.U_Member)loginUserInfo).IsIDValidate == false ? b : a;

        //认证手机
        a = " <a class=\"u-security\" href=\"javascript:;\"   data-msg=\"您已绑定手机" + ((LY.Entity.U_Member)loginUserInfo).Mobilenumber.Substring(0, 3) + "****" + ((LY.Entity.U_Member)loginUserInfo).Mobilenumber.Substring(7, 4) + "。<a target='_self' href='/Account/PhoneCertification'>更改</a>\"><img src=\"/Content/Images/user2.png\" data-step=\"5\" data-intro=\"更改您的认证您的手机！\"/></a>";
        b = " <a class=\"u-security\" href=\"javascript:;\"  data-msg=\"您还没认证手机。<a  href='/Account/PhoneCertification'>立刻认证</a>\"><img src=\"/Content/Images/user2-2.png\" data-step=\"5\" data-intro=\"认证您的手机！\" /></a>";

        mobilePhone = ((LY.Entity.U_Member)loginUserInfo).IsPhoneValidate == false ? b : a;

        //电子邮件
        a = " <a class=\"u-security\" href=\"javascript:;\"   data-msg=\"" + ((LY.Entity.U_Member)loginUserInfo).Email + "。<a target='_self' href='/Account/EmailCertification'>更改</a>\"><img src=\"/Content/Images/user3.png\" data-step=\"6\" data-intro=\"更改您的认证邮箱！\"/></a>";
        b = " <a class=\"u-security\" href=\"javascript:;\"  data-msg=\"您还没认证邮箱。<a  href='/Account/EmailCertification'>立刻认证</a>\"><img src=\"/Content/Images/user3-3.png\" data-step=\"6\" data-intro=\"认证您的邮箱！\"/></a>";
        email = ((LY.Entity.U_Member)loginUserInfo).IsEmailValidate == false ? b : a;

        //支付密码
        a = " <a class=\"u-security\" href=\"javascript:;\"   data-msg=\"您已设置支付密码。<a target='_self' href='javascript:void(0)' onclick='QuShengFuTong()'>修改</a>\"><img src=\"/Content/Images/user4.png\" data-step=\"7\" data-intro=\"修改您的托管账户支付密码！\" /></a>";
        b = " <a class=\"u-security\" href=\"javascript:;\"  data-msg=\"您还未开通盛付通。<a  href='../Account/AccountInfo'>立刻开通</a>\"><img src=\"/Content/Images/user4-4.png\" data-step=\"7\" data-intro=\"设置您的托管账户支付密码！\" /></a>";
        password = ((LY.Entity.U_Member)loginUserInfo).IsIDValidate == false ? b : a;

    } 
}

@section style{
    <link href="~/Scripts/intro/introjs.css" rel="stylesheet" />
}
@section script{
    <script src="~/Content/assets/app/common/ajaxupload.js" ></script>
    <script src="~/Scripts/intro/intro.js"  charset="gb2312"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            
            introJs().setOption('showBullets', false).start();

            if ('@IsPasswordValidate' == 'False') {
                $("#u,#f").attr("href", "javascript:void(0)");
            }
            //如果用户状态为企业
            if ('@Classify' == '企业') {
                $("#CompanyName").css('display', '');
                $("#CompanyFaxes").css('display', '');
            }

            //判断公司认证状态
            if ('@Status' == 0) {
                $("#lblStatus").html("未认证");
                $("#lblGo").html("立即认证");
            } else if ('@Status' == 1) {
                $("#lblStatus").html("审核中");
                $("#lblGo").html("查看");
            } else if ('@Status' == 2) {
                $("#lblStatus").html("已认证");
                $("#lblGo").html("编辑");
            } else {
                $("#lblStatus").html("未通过");
                $("#lblGo").html("编辑");
            }

            //点击认证公司的时候 判断是否开通了胜付通
            $("#lblGo").click(function () {
                if ('@IsIDValidate' == "False") {
                    $.dialog.tips("请先开通盛付通", 2, "tips.gif", function () {
                        window.location.href = "../Account/AccountInfo";
                    });
                    return false;
                } else {
                    return true;
                }

            });
        })
        //去盛付通首页

        function QuShengFuTong() {
            //var sign = "merchantNo=" + $("#tzmerchantNo").val() + "&timestamp=temp&userName=" + $("#tzuserName").val();

            //sign = sign.replace(/\&/g, "|");
            //$.ajax({
            //    url: "/Account/GetSign2",
            //    type: "Post",
            //    success: function (data) {
            //        var time = data.substring(0, 14);
            //        var sign2 = data.substring(14, data.length);
            //        $("#tztimestamp").val(time);
            //        $("#tzsign").val(sign2);
            //        $("#formShouYe").submit();
            //    },
            //    data: "sign=" + sign,
            //});

            var url = "url:/Account/QuShengFuTongMiddlePage?userName=" + escape($("#tzuserName").val());
            $.dialog({
                content: url,
                width: '1200px',
                height: '800px',
                lock: true,
                fixed: true,
                background: '#000', /* 背景色 */
                opacity: 0.5,       /* 透明度 */
                drag: false,
                resize: false,
                title: '全局金服>盛付通托管平台',
                //close: function () {
                //    parent.location.reload();
                //    return true;
                //}
            });
        }
    </script>
}


<div class="RightContrent">
    <div style="margin-left: 50px; margin-right: 50px;">
        <div class="tab-content">
            <div class="line10"></div>
            <div class="line10"></div>
            <div class="tab_title">@ViewBag.Title</div>
            <div class="tab-content">
                <div style="width: 16px; height: 12px; float: left;">
                    <img src="~/Content/Images/leftarraw.png" />
                </div>
            </div>

            <div class="tab-content_border">
                <div class="u-form-wrap" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 20px">
                    <div class="a_tit-1">

                        <a href="@Url.Action("PersonSet")">
                            <img src="@headImage" class="u-img"/></a>

                        <div class="u-name">
                            <dl>
                                <dt>昵&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称:
                                </dt>
                                <dd style="width: 200px" >@loginName  (@Classify)&nbsp;&nbsp;
                                    <a href="@Url.Action("PersonSet")" style='color: #EC303F;text-decoration:underline' data-step="1" data-intro="给自己取一个独一无二的昵称吧！">点击修改昵称</a>
                                </dd>
                            </dl>
                        </div>
                        <div class="u-name">
                            <dl>
                                <dt>绑定邮箱:</dt>
                                <dd>
                                    @if (IsEmailValidate == true)
                                    {
                                        @loginUserInfo.Email
                                    }
                                    else
                                    {
                                        @Html.ActionLink("立刻验证", "EmailCertification", "Account", new { style = "color: #EC303F;text-decoration:underline" });
                                    }

                                </dd>
                            </dl>
                        </div>
                        <div class="u-name">
                            <dl>
                                <dt>真实姓名:</dt>
                                <dd>@RealName</dd>
                            </dl>
                        </div>
                        <div class="u-name">
                            <dl>
                                <dt>绑定手机:</dt>
                                <dd>
                                    @Mobilenumber

                                </dd>
                            </dl>
                        </div>
                        <div class="u-name" style="clear: both;">
                            <dl style="width: 100px; margin: 0px 0px 0px 35px">
                                <a href="@Url.Action("PersonSet")" style='color: #EC303F;text-decoration:underline;' data-step="2" data-intro="修改个人资料！">修改个人资料</a>
                            </dl>
                        </div>

                        <!--公司信息 -->
                        <div class="u-name" id="CompanyName" style="display: none">
                            <dl style="margin: 0px 0px 0px -5px">
                                <dt>公司名称:</dt>
                                <dd>@CompanyName
                                </dd>
                            </dl>
                        </div>
                        <div class="u-name" id="CompanyFaxes" style="display: none">
                            <dl>
                                <dt>公司传真:</dt>
                                <dd>@Faxes
                                </dd>
                            </dl>
                        </div>


                        <div class="line10"></div>

                        <ul class="u-setting">
                            <li>
                                @Html.Raw(realName)

                            </li>
                            <li>
                                @Html.Raw(mobilePhone)

                            </li>
                            <li>
                                @Html.Raw(email)

                            </li>
                            <li>
                                @Html.Raw(password)

                            </li>
                        </ul>
                        <div class="serve_info ">
                            <p>
                                <span class="si1">登录密码：</span>
                                <span class="si2">登录时需验证，保护账户信息</span>
                                <span class="si3"><a href="@Url.Action("ChangePassword")" style="color: #EC303F;text-decoration:underline" data-step="3" data-intro="在这里修改你的登陆密码！">修改登录密码</a></span>
                            </p>
                            <p>
                                <span class="si1">支付密码：</span>
                                <span class="si2">资金变动或账户信息变更时需验证，安全级别更高。</span>
                                <span class="si3">
                                    @{
                                        if (IsIDValidate == true)
                                        {
                                        <label>您已设置支付密码</label>
                                        <a id="u" href="javascript:void(0)" onclick="QuShengFuTong()" style="color: #EC303F; text-decoration: underline">修改</a>
                                        }
                                        else
                                        {
                                        <label>你还没有开通盛付通</label>
                                        <a href="../Account/AccountInfo" style="color: #EC303F; text-decoration: underline">立即开通</a>
                                        }
                                      
                                    }

                                </span>
                            </p>
                            <p>
                                <span class="si1">身份验证：</span>
                                <span class="si2">
                                    @if (IsIDValidate)
                                    {
                                        @Html.Raw("实名证件号码：")@LY.Common.Utils.Tools.MyChar('*', 10, loginUserInfo.IDCode, 4, 4)
                                    }
                                    else
                                    {
                                        @Html.Raw("您还没进行身份验证")
                                    }
                                </span>
                                @if (IsIDValidate)
                                {
                                      
                                    <span class="si3"><a href="@Url.Action("PersonalCertification")" style="color: #EC303F;text-decoration:underline">查看</a></span>
                                }
                                else
                                {
                                    <span class="si3"><a href="@Url.Action("PersonalCertification")" style="color: #EC303F;text-decoration:underline">立即实名</a></span>
                                }


                            </p>
                            <p data-step="8" data-intro="升级为公司账号！">
                                <span class="si1">公司认证：</span>
                                <span class="si2">个人用户，升级为企业用户</span>

                                <span class="si3">
                                    <label id="lblStatus"></label>
                                    <a href="@Url.Action("CompanyApprove")" id="lblGo" style="color: #EC303F;text-decoration:underline"></a>
                                </span>
                            </p>
                        </div>
                        <form action="@ViewBag.SftAddress/index.html" method="POST" id="formShouYe" target="_blank">
                            <input type="hidden" name="merchantNo" id="tzmerchantNo" value="@ViewBag.merchantNo"/>
                            <input type="hidden" name="timestamp" id="tztimestamp" value="" />
                            <input type="hidden" name="userName" id="tzuserName" value="@ViewBag.userName"/>
                            <input type="hidden" name="sign" id="tzsign" value="" />
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
